﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using COM.Rights.Model;
using COM.Rights.BLL;
using System.Data;

public partial class Pages_BdNews_Default : ZMPageList<BdNews,BdNewsInfo>
{  
	#region 重写方法
    protected override string DefaultSortField
    {
        get
        {
            return "CreateDate Desc,NewsTitle";
        }
    }

    protected override void OnLoad()
    {
        base.OnLoad();
    }

    protected override void OnBind()
    {
        base.OnBind();

        PermUserWeb _PermUserWeb = new PermUserWeb();
        List<DBParameter> _listDBParameter = new List<DBParameter>();
        _listDBParameter.Add(new DBParameter("@TranType", "hostname"));
        _listDBParameter.Add(new DBParameter("@UID", ZASession.Account));

        IDataReader sdr = _PermUserWeb.ExecuteReader("[dbo].[mdlist_sel]", _listDBParameter, System.Data.CommandType.StoredProcedure);
        DataTable dt = new DataTable();
        dt.Load(sdr);

        ZABinder.FillList(string.Empty, ddlHostName, true, dt);
    }

    protected override int PageSize
    {
        get
        {
            //return base.PageSize;
            return StringHelper.FormatBlankStringToint(txtPageSize.Text);
        }
    }

    protected override string DefaultFilter
    {
        get
        {
            return string.Format("IsDelete = 0 AND    hostname IN ( SELECT hostname FROM permUserWeb puw(NOLOCK) WHERE puw.UID = '{0}' )", ZASession.Account);
            //return string.Format(" EXISTS( SELECT 1 FROM permUserWeb puw WHERE 1=1)");
        }
    }

    protected override void ToolBarSearchClick(object sender, ImageClickEventArgs e)
    {
        base.ToolBarSearchClick(sender, e);
    }

    //不显示保存按纽
    protected override void InitBtnSave()
    {
        //base.InitBtnSave();
    }

    protected override void ToolBarDeleteClick(object sender, ImageClickEventArgs e)
    {
        
        base.ToolBarDeleteClick(sender, e);
    }

    protected override void OnMainGridRowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e)
    {
        base.OnMainGridRowDeleting(sender, e);
    }

	#endregion 	重写方法
}